import request from '@/utils/request'

export function needs(data) {
  return request({
    url: '/needs',
    method: 'put',
    data
  })
}
// 获取组员列表
export function groupList(data) {
  return request({
    url: `/andon_group`,
    method: 'get',
    params: data
  })
}

export function uploadFileNeed(id, file) {
  return request({
    url: `/needs/uploadFile/${id}`,
    method: 'post',
    data: file
  })
}
// 添加组员
export function reviewe(data) {
  return request({
    url: '/needs/add/reviewer',
    method: 'post',
    data
  })
}

// 删除组员
export function delReviewe(data) {
  return request({
    url: '/needs/delete/reviewer',
    method: 'delete',
    data
  })
}
// 获取文件列表
export function getFile(needevaluationid, file) {
  return request({
    url: `/needs/file/${needevaluationid}`,
    method: 'get',
    params: file
  })
}
// 获取需求列表
export function getInfo(query) {
  return request({
    url: '/needs/query',
    method: 'get',
    params: query
  })
}
export function cancle(fileid) {
  return request({
    url: `/needs/uploadFile/cancel/${fileid}`,
    method: 'put'

  })
}
export function getProjectPerson(needevaluationid) {
  return request({
    url: `/needs/reviewer/${needevaluationid}`,
    method: 'get'

  })
}
export function detail(id) {
  return request({
    url: `/needs/detail/${id}`,
    method: 'get'

  })
}

export function addchat(data) {
  return request({
    url: `/needs/chat`,
    method: 'post',
    data
  })
}
export function getchart(needevaluationid) {
  return request({
    url: `/needs/bbs/${needevaluationid}`,
    method: 'get'

  })
}

export function shenHe(data, id) {
  return request({
    url: `/needs/check/${id}`,
    method: 'post',
    data
  })
}
export function download(id) {
  return request({
    url: `/needs/downloadFile/${id}`,
    method: 'get',
    responseType: 'arraybuffer'
  })
}
export function getGroupList() {
  return request({
    url: `/andon_group/list `,
    method: 'get'

  })
}
export function addgroup(data) {
  return request({
    url: `/needs/add/group/reviewer`,
    method: 'get',
    params: data
  })
}

